//
//  DarkModeBoot.swift
//  SwiftUIWidgetDemo
//
//  Created by alanzhangg on 2023/7/18.
//

import SwiftUI

struct DarkModeBoot: View {
    
    @Environment(\.colorScheme) var colorScheme
    
    var body: some View {
        NavigationStack {
            ScrollView {
                VStack(spacing: 20){
                    Text("this text is Primary")
                        .foregroundStyle(.primary)
                    Text("this color is sec")
                        .foregroundStyle(.secondary)
                    Text("this color is black")
                        .foregroundStyle(.black)
                    Text("color is white")
                        .foregroundStyle(.white)
                    Text("this color is red")
                        .foregroundStyle(.red)
                    Text("this color is asset")
                        .foregroundStyle(Color("CustomColor", bundle: nil))
                    Text("this color is locally")
                        .foregroundStyle(colorScheme == .light ? .green : .yellow)
                }
            }
            .navigationTitle("Dark Mode Boot")
        }
    }
}

#Preview {
    Group{
        DarkModeBoot()
            .preferredColorScheme(.light)
    }
    
}
